/* CSS变量定义 */
:root {
    /* 浅色模式默认颜色 */
    --bg-color: #ffffff;
    --text-color: #333333;
    --secondary-text-color: #666666;
    --header-bg: #2c3e50;
    --nav-link-color: #ffffff;
    --nav-link-hover: #3498db;
    --section-bg: #f8f9fa;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --border-color: #e0e0e0;
    --input-bg: #ffffff;
    --input-border: #dddddd;
    --input-focus: #3498db;
    --button-bg: #3498db;
    --button-hover: #2980b9;
    --hero-gradient-start: #3498db;
    --hero-gradient-end: #8e44ad;
    --timeline-color: #3498db;
    --skill-tag-bg: #3498db;
    --skill-tag-hover: #2980b9;
}

/* 深色模式 */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --secondary-text-color: #b0b0b0;
    --header-bg: #0d1117;
    --nav-link-color: #ffffff;
    --nav-link-hover: #58a6ff;
    --section-bg: #161b22;
    --card-bg: #0d1117;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --border-color: #30363d;
    --input-bg: #0d1117;
    --input-border: #30363d;
    --input-focus: #58a6ff;
    --button-bg: #238636;
    --button-hover: #2ea043;
    --hero-gradient-start: #238636;
    --hero-gradient-end: #1f6feb;
    --timeline-color: #58a6ff;
    --skill-tag-bg: #238636;
    --skill-tag-hover: #2ea043;
}

/* 基本重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 导航样式 */
header {
    background-color: var(--header-bg);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    color: var(--nav-link-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--nav-link-color);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--nav-link-hover);
}

/* 导航控制区域 */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 主题切换器 */
.theme-switcher {
    margin-right: 0.5rem;
}

.theme-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--nav-link-color);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.theme-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) rotate(180deg);
}

/* 语言切换器 */
.language-switcher {
    margin-left: 0;
}

.lang-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--nav-link-color);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* 主要内容区域 */
main {
    margin-top: 80px; /* 为固定导航留出空间 */
}

section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 英雄区域样式 */
.hero {
    background: linear-gradient(135deg, var(--hero-gradient-start), var(--hero-gradient-end));
    color: white;
    text-align: center;
    padding: 6rem 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

#cta-button {
    background-color: var(--button-bg);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#cta-button:hover {
    background-color: var(--button-hover);
}

/* 个人介绍区域 */
.introduction {
    background-color: var(--card-bg);
    padding: 4rem 2rem;
}

.intro-container {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 3rem;
}

.profile-picture {
    flex: 1;
    text-align: center;
}

#profile-img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--button-bg);
    box-shadow: 0 4px 8px var(--card-shadow);
}

.intro-text {
    flex: 2;
}

.intro-text h2 {
    color: var(--text-color);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.intro-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--secondary-text-color);
}

/* 关于我区域 */
.about {
    background-color: var(--section-bg);
    padding: 4rem 2rem;
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
}

.about-intro {
    margin-bottom: 3rem;
}

.about-intro h3 {
    color: var(--text-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.about-intro p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--secondary-text-color);
}

/* 技能标签部分 */
.skills-section {
    margin-bottom: 3rem;
}

.skills-section h3 {
    color: var(--text-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.skill-category {
    flex: 1;
    min-width: 250px;
}

.skill-category h4 {
    color: var(--button-bg);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background-color: var(--skill-tag-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background-color: var(--skill-tag-hover);
    transform: translateY(-2px);
}

.skill-tag.python {
    background-color: #3776ab;
}

.skill-tag.mongodb {
    background-color: #47a248;
}

.skill-tag.nextjs {
    background-color: #000000;
}

.skill-tag.elasticsearch {
    background-color: #005571;
}

.skill-tag.rust {
    background-color: #ce422b;
}

/* 时间线部分 */
.timeline-section {
    margin-bottom: 3rem;
}

.timeline-section h3 {
    color: var(--text-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--timeline-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--timeline-color);
    border: 2px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--timeline-color);
}

.timeline-date {
    color: var(--timeline-color);
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    color: var(--text-color);
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.timeline-content p {
    color: var(--secondary-text-color);
    font-size: 1rem;
}

/* 个人成就部分 */
.achievements-section {
    margin-bottom: 2rem;
}

.achievements-section h3 {
    color: var(--text-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.achievement-item {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: transform 0.3s ease;
}

.achievement-item:hover {
    transform: translateY(-5px);
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.achievement-item h4 {
    color: var(--text-color);
    font-size: 1.2rem;
}

/* 项目区域 */
.projects {
    background-color: var(--card-bg);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background-color: var(--section-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-card h3 {
    padding: 1rem;
    color: var(--text-color);
}

.project-card p {
    padding: 0 1rem 1rem;
    color: var(--secondary-text-color);
}

/* 联系区域 */
.contact {
    background-color: var(--section-bg);
    padding: 4rem 2rem;
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-form-section,
.social-links-section {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--card-shadow);
}

.contact-form-section h3,
.social-links-section h3 {
    color: var(--text-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background-color: var(--input-bg);
    color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--input-focus);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    background-color: var(--button-bg);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

/* 社交媒体链接部分 */
.social-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background-color: var(--section-bg);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.social-link:hover {
    background-color: var(--card-bg);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px var(--card-shadow);
}

.social-icon {
    font-size: 2rem;
    margin-right: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--button-bg);
    color: white;
    border-radius: 50%;
}

.social-info h4 {
    color: var(--text-color);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.social-info p {
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}

/* 页脚 */
footer {
    background-color: var(--header-bg);
    color: var(--nav-link-color);
    text-align: center;
    padding: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
    }
    
    .nav-links {
        margin-top: 1rem;
    }
    
    .nav-links li {
        margin: 0 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 2rem 1rem;
    }
    
    /* 个人介绍区域响应式 */
    .intro-container {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-picture {
        margin-bottom: 2rem;
    }
    
    #profile-img {
        width: 200px;
        height: 200px;
    }
    
    /* 技能标签区域响应式 */
    .skills-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .skill-category {
        width: 100%;
    }
    
    /* 时间线区域响应式 */
    .timeline {
        padding-left: 1rem;
    }
    
    .timeline-item {
        padding-left: 1.5rem;
    }
    
    .timeline-item::before {
        left: -1.8rem;
    }
    
    /* 成就区域响应式 */
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    /* 联系区域响应式 */
    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-form-section,
    .social-links-section {
        padding: 1.5rem;
    }
    
    .social-link {
        padding: 1rem;
    }
    
    .social-icon {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
        margin-right: 1rem;
    }
    
    .social-info h4 {
        font-size: 1rem;
    }
    
    .social-info p {
        font-size: 0.8rem;
    }
    
    /* 导航区域响应式 */
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-controls {
        flex-direction: row;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .theme-switcher {
        margin-right: 0;
        margin-left: 0.5rem;
    }
    
    .language-switcher {
        margin-left: 0;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 0 0.5rem 0.5rem 0;
    }
    
    .theme-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}
